import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import moment from 'moment';
import 'moment/locale/zh-cn';

import './index.less';
import 'assets/css/index.less';
import enviroment from 'config/environment.json';
import initStore from 'config/store';
import setupAxiosInterceptors from 'config/axios-interceptor';
import { DevRibbon } from 'components/dev-ribbon';
import * as serviceWorker from 'serviceWorker';
import App from './App';

const store = initStore();
setupAxiosInterceptors();

moment.locale('zh-cn');

ReactDOM.render(
  <Provider store={store}>
    <DevRibbon env={enviroment.env} />
    <App />
  </Provider>,
  document.getElementById('root'),
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
